﻿using System;
using EasyStep.Attributes;using EasyStep.TestExecution.Data;using EasyStep.TestExecution.Interfaces;

using OpenQA.Selenium;

namespace EasyStep.TestActions.Actions.Fill
{
    [TestAction(typeof(Fill), Name = "ByClassName")]
    class FillByClassName : ITestAction<IWebDriver>
    {
        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            browser.FindElement(By.ClassName(data.Locator)).Clear();
            browser.FindElement(By.ClassName(data.Locator)).SendKeys(data.Data);
        }
    }
}
